//创建用户的约束条件及模型对象
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const student_infoSchema = new Schema({
    stu_id:{
        //类型
        type:String,
        //唯一
        unique:true,
        //必须
        required:true
    },
    stu_name:{
        type:String,
        unique:false,
        required:true
    },
    stu_sex:{
        type:String,
        unique:false,
        required:true
    },
    stu_jg:{
        type:String,
        unique:false,
        required:true
    },
    stu_date:{
        type:Date,
        default:Date.now
    },
    stu_hobby:Schema.Types.Mixed,
    stu_gbf:{
        type:String,
    },
    stu_head_img:{
        type:String,
    },
})
//创建模型对象
//参数一:创建集合名   参数二：约束条件
const Student_info = mongoose.model('student_info',student_infoSchema);
module.exports = Student_info;